package com.dormitoryAdministratorSystem.util;

public class CheckFormatUtil {
    private  CheckFormatUtil(){}

    public static boolean isPhoneNum(String phoneNum){
        return phoneNum.matches("(13|15|18|17|19)\\d{9}");
    }

    public static boolean isNum(String s){
        return s.matches("([4-9])|([1-2][0-9])");
    }

    public static boolean isDouble(String s){
        return s.matches("(\\d{3})|(\\d{4})|(\\d{4}\\.\\d{2})|(\\d{3}\\.\\d{2})");
    }

    public static boolean checkLength(String s, int low, int high){
        return s.matches("\\S{"+low+","+high+"}");
    }
}
